package ThreadPoolText;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Text {
    public static void main(String[] args) {
        ExecutorService pool = Executors.newFixedThreadPool(3);
        Student s1 = new Student("于飞正");
        Student s2 = new Student("杨昊");
        Student s3 = new Student("陈志伟");
        Student s4 = new Student("袁晓强");
        Student s5 = new Student("张吉祥");
        pool.submit(s1);
        pool.submit(s2);
        pool.submit(s3);
        pool.submit(s4);
        pool.submit(s5);
        //任务结束，销毁线程，结束任务
        pool.shutdown();
    }
}
